#include "Troll3D/Mesh.h"
#include "Troll3D/Program.h"
#include "Troll3D/Shader.h"
#include <Troll3D/View.h>
#include <Troll3D/Entity.h>
#include <Troll3D/Application.h>
#include <Troll3D/Image.h>
#include <Troll3D/TrackView.h>


GLSLProgram * prog;

int main()
{
    // First thing is to create a new SFMLWindow with the appropriate size
    // The creation of the Window will also set the OpenGL Context, thus, allowing us to call glewinit()
    SFMLWindow * window = Application::SetWindow(500, 500, 60);

    // Here I start the appliation
    Application::Init();

    // I create a new program from 2 basic Shaders
	GLSLProgram::New("Default", new Shader(GL_FRAGMENT_SHADER,"basique.frag"), new Shader(GL_VERTEX_SHADER,"basique_2D.vert"));
	
	//	Here I create a New entity, wich would automaticaly be added to Entity::Entities	
    Entity::New( Mesh::NewRect(1.0, 1.0));


    Entity::Last().m_Mesh->m_Image = new Image("mov.png");
    Entity::Last().m_Mesh->m_Image->GenTexture();
    Entity::Last().m_GLSLProgram = GLSLProgram::Programs.at(0)->m_GLID;

    Entity::New( Mesh::NewRect(1.0, 1.0));
    Entity::Last().m_Transform.Translate(1.0, 0.0, 0.0);
    Entity::Last().m_GLSLProgram    =   GLSLProgram::Programs.at(0)->m_GLID;
    new TrackView();


    Application::Loop();
}
